build: centralize system library staging - #339
Open
ardentperf wants to merge 5 commits into
Open
Conversation
Port the dynamic system-library staging helper from a0822b5 to the upstream extension tree and update the shared Bake context so PostGIS can use it.
Keep the upstream Docker Bake context unchanged by placing the helper under postgis/scripts.
Restore the already-tested root-context layout so the shared helper remains in scripts/.
PostGIS passes extension-library globs, so the helper needs only its single symlink-reconstruction pass; retain the explicit alias handling only when a future caller requires it.
Keep the explicit input-alias pass and document why it is needed when ldd reports only a resolved soname, such as the libmysqlclient.so case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
while working on adding extensions at the downstream project CNPG-Extensions, I have onboarded quite a few additional extensions that require system libraries. (Examples: h3, mobilitydb, mysql-fdw, plr, tds-fdw, etc)
this requires the same logic that postgis has to recursively find and stage system libraries in the extension container image. rather than duplicating all of this logic across a bunch of extensions, it makes more sense to move the logic into a shared script. it works fairly well.
note that i had to change the context in the root
docker-bake.hclfile. i dont think this breaks any existing extensions; i dont think any were doing COPY into their builder image yet.i did need to also add a second symlink resolution loop. this is technically not needed for postgis but it would be needed for extensions like mysql-fdw that pass in a symlink as an argument.
Validation
bash -n scripts/stage_system_libs.shlinux/amd64andlinux/arm64verified: true,reason: validnb. please squash merge and don't attribute my bot 🙂